<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button id="btn">
获取后台信息
</button>
<textarea id="text" zjd="2020">
</textarea>
<script src="jquery/jquery-3.4.1.min.js">
</script>
<script>
    //入口函数
    $(document).ready(function(){
        $.ajax({
            type:'GET',
            url:"http://localhost:8080/depart/findAll",
            dataType:"json",
            success:data=>{
                data=JSON.stringify(data);
                console.log(data);
                alert(data);
            },error:data=>{
                console.log(data);
                text.attr("zjd","hasError");
            }
        })

    });

</script>
</body>
</html>